import React, { Component } from 'react'
import DemoZi from "./demoZi"
import Scud from "./scud"
export default class demoFu extends Component {
    constructor(props){
        super(props)
        this.state={
            arr:[
                {name:"123",style:false},
                {name:"432",style:false},
                {name:"234",style:false},
                {name:"545",style:false}
            ]
        }
    }
    fuFun=(num)=>{
        let newArr=this.state.arr;
        newArr[num].style = !newArr[num].style

        this.setState({
            arr:newArr
        })
    }
    render() {
        return (
            <div>
                {
                    this.state.arr.map((v,i)=>{
                        return (
                            <DemoZi key={i} name={v.name} style={v.style} i={i} ziFun={this.fuFun}/>
                        )
                    })
                }
                {/* <DemoZi/> */}
                <Scud/>
            </div>
        )
    }
}
